package com.qq2008.game;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;

@SpringBootApplication
public class MojieApplication {

    public static void main(String[] args) {
        //
        ApplicationContext context = SpringApplication.run(MojieApplication.class, args);
        //
        try {
            InetAddress address = InetAddress.getLocalHost();
            Environment environment = context.getBean(Environment.class);
            String port = environment.getProperty("server.port");
            String contextPath = "/login";
            System.out.println("启动完成,访问地址: http://" + address.getHostAddress() + ":" + port + contextPath);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

